/**
 * 作者: LDL
 * 说明:
 * 时间: 2015/7/19 15:20
 */
class UseTrait {

}
trait Logger{
    def log(msg:String): Unit ={
        println("log:"+msg)
    }
}

trait traitLogger{
    def log(msg:String)
}

trait FLogger{
    def log(msg:String): Unit ={
        println("Log content is :"+msg)
    }
}

trait MessageLogger extends FLogger{
    override def log(msg:String): Unit ={
        println("Log Message is :"+msg)
    }
}

abstract class Account{
    def save
}

class MyAccount extends Account with FLogger{
    def save(): Unit ={
        log("10000")
    }
}

trait ConsoleLogger extends traitLogger{
    def log(msg:String): Unit ={
        println(msg)
    }
}

class Test extends ConsoleLogger{
    def test(): Unit ={
        log("here is spark")
    }
}
class ConcreteLogger extends Logger{
    def concreteLog: Unit ={
        log("It's ms!")
    }
}

object UseTrait extends App{
    val logger = new MyAccount
    logger.save()
}